﻿
using System;

namespace HmFramework.Text
{

	public struct StringReference
	{

		private readonly Char[] _chars;
		private readonly Int32 _startIndex;
		private readonly Int32 _length;

		public Char[] Chars
		{
			get { return _chars; }
		}

		public Int32 StartIndex
		{
			get { return _startIndex; }
		}

		public Int32 Length
		{
			get { return _length; }
		}

		public StringReference(Char[] chars, Int32 startIndex, Int32 length)
		{
			_chars = chars;
			_startIndex = startIndex;
			_length = length;
		}

		public override String ToString()
		{
			return new String(_chars, _startIndex, _length);
		}
	}
}